﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; 

namespace Genealogy_Builder
{
    public partial class TraceLineageDialog : Form
    {
        public Person root = null;
        public int genBack = 0;
        public int genForward = 0;

        public TraceLineageDialog(List<Person> People)
        {
            InitializeComponent();
            personSelectBox.DataSource = People;
            for (int i = 0; i < 20; i++)
            {
                generationsBackBox.Items.Add(i);
                generationsForwardBox.Items.Add(i);
            }
            generationsBackBox.SelectedIndex = 0;
            generationsForwardBox.SelectedIndex = 0;
        }

        private void TraceLineageDialog_Load(object sender, EventArgs e)
        {

        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            root = (Person) personSelectBox.SelectedItem;
            genBack = (int) generationsBackBox.SelectedItem;
            genForward = (int)generationsForwardBox.SelectedItem;

            this.Close(); 
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            root = null;
            genBack = 0;
            genForward = 0;

            this.Close();
        }

    }
}
